//
//  DetailViewController.h
//  VMIX
//
//  Created by jeffs on 5/14/10.
//  Copyright VMIX Media Inc. 2010. All rights reserved.
//

#import <UIKit/UIKit.h>
#import <CoreData/CoreData.h>
#import <MediaPlayer/MediaPlayer.h>


@class RootViewController;
@class VmixVideo;


@interface DetailViewController : UIViewController <UIPopoverControllerDelegate, UISplitViewControllerDelegate, PlayVideoOperationDelegate> {
    
    UIPopoverController *popoverController;
    UIToolbar *toolbar;
    
    NSManagedObject *detailItem;
    UILabel *detailDescriptionLabel;

    RootViewController *rootViewController;
	
	IBOutlet UIView *moviePlayerView;
	IBOutlet UIView *moviePlayerPortraitView;
	
	CGRect rootViewFrame;
	CGRect detailViewFrame;
	
	VmixVideo *currentVideo;
	
	IBOutlet UILabel * videoTitle;
	IBOutlet UILabel * uploadDate;
	IBOutlet UITextView * descriptionText;
	
	MPMoviePlayerController* theMoviePlayer;
	IBOutlet UIActivityIndicatorView * moviePlayerLoadingSpinner;
	NSOperationQueue *oppQueue;
	PlayVideoOperation * playVideoOperation;
	
	
}

@property (nonatomic, retain) IBOutlet UIToolbar *toolbar;
@property (nonatomic, retain) NSManagedObject *detailItem;
@property (nonatomic, retain) IBOutlet UILabel *detailDescriptionLabel;
@property (nonatomic, assign) IBOutlet RootViewController *rootViewController;
@property (nonatomic, retain) IBOutlet UIView *moviePlayerView;
@property CGRect rootViewFrame;
@property CGRect detailViewFrame;
@property (nonatomic, retain) VmixVideo *currentVideo;
@property (nonatomic, retain) UILabel * videoTitle;
@property (nonatomic, retain) UILabel * uploadDate;
@property (nonatomic, retain) UITextView * descriptionText;
@property (nonatomic, retain) MPMoviePlayerController* theMoviePlayer;
@property (nonatomic, retain) UIActivityIndicatorView * moviePlayerLoadingSpinner;
@property (nonatomic, retain) NSOperationQueue *oppQueue;
@property (nonatomic, retain) PlayVideoOperation * playVideoOperation;
@property (nonatomic, retain) IBOutlet UIView *moviePlayerPortraitView;

- (IBAction)insertNewObject:(id)sender;
- (void)loadVideo:(VmixVideo *) video;
- (void)didFinishParsingPlayData:(NSURL *) playUrl;
- (void)expandView;
- (void)collapseView;

@end
